home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 34.zip
/
BS1 part 34
/
megadisc PD 14.adf
/
PROGRAMS
/
AREXX
/
man.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1989-12-11
|
1KB
|
49 lines
/* UNIX-like `man' command to display documentation files */
arg arg1 arg2 arg3 arg4 /* parse the command line */
if arg1 = '-D' then ; do /* we have been given a doc path */
if arg4 ~= '' then ; do
say 'man: too many arguments'
exit 5
end
if arg2 = '' then ; do
say 'man: missing documentation path'
exit 5
end
if arg3 = '' then ; do
say 'man: program not specified'
exit 5
end
rt = right( arg2, 1 ) /* Get the doc path into the form */
if rt ~= ':' & rt ~= '/' then /* we want; pathname followed by */
docpath = arg2'/' /* either a ':' or a '/', as */
else /* appropriate. */
docpath = arg2
docfile = arg3
end
else ; do /* we should only have a keyword */
if arg2 ~= '' then ; do
say 'man: too many arguments'
exit 5
end
if arg1 = '' then ; do
say 'Usage: man [-d <DocPath>] <ProgramName>'
exit 0
end
docpath = 'DOC:'
docfile = arg1
end
if exists( docpath||docfile'.doc' ) then ; do
address command
'arun vdk:less' docpath||docfile'.doc' /* display the doc file */
exit 0
end
else ; do /* can't find the documentation file */
say 'man: documentation not available'
exit 10
end